home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
scilab
/
demos
/
signal
/
remezfilt.dem
< prev
next >
Wrap
Text File
|
1999-09-16
|
944b
|
36 lines
function []=remezfilt()
////////////////////////
//MINIMAX FIR FILTERS///
////////////////////////
// clear
//Low pass filter (length 33, cut-off in [.23,.27], weight 1/.1)
hn=eqfir(33,[0 .23;.27 .5],[1 0],[1 .1]);
[hm,fr]=frmag(hn,256);
plot2d(fr',hm'),
title_c=['Minimax FIR filter';
'low pass cut-off in [.23,.27]';
'length 33'];
xtitle(title_c);
halt(),xbasc();
//Triangular filter created using remezb
nc=21;
ngrid=nc*16;
fg=.5*(0:(ngrid-1))/(ngrid-1);
ds(1:ngrid/2)=(0:-1+ngrid/2)*2/(ngrid-2);
ds(ngrid/2+1:ngrid)=ds(ngrid/2:-1:1);
wt=ones(fg);
[an]=remezb(nc,fg,ds,wt);
hn(1:nc-1)=an(nc:-1:2)/2;
hn(nc)=an(1);
hn(nc+1:2*nc-1)=an(2:nc)/2;
[hm,fr]=frmag(hn,maxi(size(ds)));
plot2d(fr',hm'),
xtitle('Remez Triangular filter','frequency','magnitude');
halt();xbasc();
plot2d(fr',(hm-ds)'),
xtitle(' ','frequency','magnitude error');
halt(),xbasc();